//package cqie.cn.frame.config.realms;
//
//import org.apache.shiro.SecurityUtils;
//import org.apache.shiro.authc.AuthenticationException;
//import org.apache.shiro.authc.AuthenticationInfo;
//import org.apache.shiro.authc.AuthenticationToken;
//import org.apache.shiro.authc.UsernamePasswordToken;
//import org.apache.shiro.authz.AuthorizationInfo;
//import org.apache.shiro.authz.SimpleAuthorizationInfo;
//import org.apache.shiro.realm.AuthorizingRealm;
//import org.apache.shiro.subject.PrincipalCollection;
//import org.apache.shiro.subject.Subject;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author 王林
// * @version 1.0
// * @date 2021-09-10 周五
// * @time 17:18
// * @description
// */
//@Configuration
//public class CustomerRealm extends AuthorizingRealm {
//    @Override
//    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
//        System.out.println("执行了授权===》doGetAuthorizationInfo");
//
//        //授权 SimpleAuthorizationInfo
//        SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
////        info.addStringPermission("user:add");
//
//        // 拿到当前登录的这个对象
//        //获取当前用户
//        Subject subject = SecurityUtils.getSubject();
//        //封装用户的登录数据
////        UsernamePasswordToken token = new UsernamePasswordToken(username, password);
////
////        //设置当前用户的权限
////        info.addStringPermission(currentUser.getPermission());
//
//
//
//        return info;
//    }
//
//    @Override
//    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
//        return null;
//    }
//}
